home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************************************
- *
- *
- * ObjectMacZapp -- a standard Mac OOP application template
- *
- *
- *
- * ZErrors.cpp -- utils for throwing exceptions
- *
- *
- *
- *
- *
- * © 1996, Graham Cox
- *
- *
- *
- *
- *************************************************************************************************/
-
-
- #include "ZErrors.h"
- #include "ZDefines.h"
-
-
- void FailNIL( void* aPtr )
- {
- if ( aPtr == NULL )
- FailOSErr( memFullErr );
- }
-
-
- void FailOSErr( OSErr theErr )
- {
- if ( theErr != noErr )
- throw theErr;
- }
-
-
- void Fail()
- {
- FailOSErr( kUnknownExceptionErr );
- }
-
-
-
- void FailNILRes( void* aResPtr )
- {
- if ( aResPtr == NULL )
- FailOSErr( resNotFound );
- }
-
-
-
- void FailSilent()
- {
- FailOSErr( kSilentErr );
- }
-
-
-
- void FailParamErr( OSErr theErr )
- {
- if ( theErr != noErr )
- FailOSErr( paramErr );
- }
-
-
-
- void FailNILParam( void* aPtr )
- {
- if ( aPtr == NULL )
- FailOSErr( paramErr );
- }